package com.zwj.design.behavior.observer.demo1;

import com.zwj.design.behavior.observer.demo1.impl.CurrentConditionsDisplay;
import com.zwj.design.behavior.observer.demo1.impl.WeatherData;

/**
 * 观察者模式，气象站
 * 手动实现观察者与主题的接口
 *
 * @author 张文接
 * @version 1.0
 * @createTime 2024/3/16 22:32
 */
public class WeatherStation {
    public static void main(String[] args) {
        WeatherData weatherData = new WeatherData();
        CurrentConditionsDisplay currentConditionsDisplay = new CurrentConditionsDisplay(weatherData);
        weatherData.setMeasurements(20f, 65f, 30.4f);
        //展示当前天气信息
        currentConditionsDisplay.display();
    }
}
